import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    // mode: 'history',
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/LandingPage.vue'),
                    meta: { title: '控制中心' }
                },
                {
                    path: '/icon',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Icon.vue'),
                    meta: { title: '自定义图标' }
                },
                {
                    path: '/table',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/BaseTable.vue'),
                    meta: { title: '基础表格' }
                },
                {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Tabs.vue'),
                    meta: { title: 'tab选项卡' }
                },
                {
                    path: '/form',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/BaseForm.vue'),
                    meta: { title: '基本表单' }
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: () => import(/* webpackChunkName: "editor" */ '../components/page/VueEditor.vue'),
                    meta: { title: '富文本编辑器' }
                },
                {
                    // markdown组件
                    path: '/markdown',
                    component: () => import(/* webpackChunkName: "markdown" */ '../components/page/Markdown.vue'),
                    meta: { title: 'markdown编辑器' }
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: () => import(/* webpackChunkName: "upload" */ '../components/page/Upload.vue'),
                    meta: { title: '文件上传' }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/BaseCharts.vue'),
                    meta: { title: 'schart图表' }
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: () => import(/* webpackChunkName: "drag" */ '../components/page/DragList.vue'),
                    meta: { title: '拖拽列表' }
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/DragDialog.vue'),
                    meta: { title: '拖拽弹框' }
                },
                {
                    // 国际化组件
                    path: '/i18n',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
                    meta: { title: '国际化' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/donate',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/Donate.vue'),
                    meta: { title: '支持作者' }
                },
                {
                    path: '/users',
                    component: () => import('../components/page/preference/users.vue'),
                    meta: { title: '用户列表' }
                },
                {
                    path: '/roles',
                    component: () => import('../components/page/preference/roles.vue'),
                    meta: { title: '角色列表' }
                },
                {
                    path: '/menu',
                    component: () => import('../components/page/preference/menu.vue'),
                    meta: { title: '菜单列表' }
                },
                {
                    path: '/depts',
                    component: () => import('../components/page/preference/department.vue'),
                    meta: { title: '部门列表' }
                },
                {
                    path: '/posi',
                    component: () => import('../components/page/preference/position.vue'),
                    meta: { title: '岗位列表' }
                },
                {
                    path: '/tenant',
                    component: () => import('../components/page/preference/tenant.vue'),
                    meta: { title: '租户列表' }
                },
                {
                    path: '/develop',
                    component: () => import('../components/page/preference/develop.vue'),
                    meta: { title: '开发列表' }
                },
                {
                    path: '/category',
                    component: () => import('../components/page/develop/category.vue'),
                    meta: { title: '云元类别' }
                },
                {
                    path: '/publish',
                    component: () => import('../components/page/develop/publish.vue'),
                    meta: { title: '云元发布' }
                },
                {
                    path: '/tmnlbase',
                    component: () => import('../components/page/develop/terminal.vue'),
                    meta: { title: '终端基本信息' }
                },
                {
                    path: '/tmnlmenu',
                    component: () => import('../components/page/artifact/activeservice.vue'),
                    meta: { title: '终端菜单' }
                },
                {
                    path: '/tmnlrole',
                    component: () => import('../components/page/artifact/activeservicerole.vue'),
                    meta: { title: '终端菜单权限' }
                },
                {
                    path: '/tmnllog',
                    component: () => import('../components/page/artifact/logs.vue'),
                    meta: { title: '终端日志' }
                },
                {
                    path: '/tmnlnote',
                    component: () => import('../components/page/artifact/note.vue'),
                    meta: { title: '用户提醒' }
                },
                {
                    path: '/comment',
                    component: () => import('../components/page/artifact/comment.vue'),
                    meta: { title: '用户评论' }
                },
                {
                    path: '/feedback',
                    component: () => import('../components/page/artifact/feedback.vue'),
                    meta: { title: '用户反馈' }
                },
                {
                    path: '/membership',
                    component: () => import('../components/page/member/membership.vue'),
                    meta: { title: '用户等级' }
                },
                {
                    path: '/userpwd',
                    component: () => import('../components/page/preference/userpwd.vue'),
                    meta: { title: '修改密码'}
                },
                {
                    path: '/logs',
                    component: () => import('../components/page/preference/logs.vue'),
                    meta: { title: '日志管理' }
                },
                {
                    path: '/db',
                    component: () => import('../components/page/preference/db.vue'),
                    meta: { title: '系统备份' }
                },
                {
                    path: '/dbrestore',
                    component: () => import('../components/page/preference/dbrestore.vue'),
                    meta: { title: '系统恢复' }
                },
                {
                    path: '/api',
                    component: () => import('../components/page/member/entry.vue'),
                    meta: { title: '接口管理' }
                },
                {
                    path: '/suite',
                    component: () => import('../components/page/member/suite.vue'),
                    meta: { title: 'VIP服务管理' }
                },
                {
                    path: '/bill',
                    component: () => import('../components/page/member/bill.vue'),
                    meta: { title: '订单管理' }
                },
                {
                    path: '/mediacast',
                    component: () => import('../components/page/artifact/mediacast.vue'),
                    meta: { title: '广告管理' }
                },
                {
                    path: '/mediacasttarget',
                    component: () => import('../components/page/artifact/mediacasttarget.vue'),
                    meta: { title: '广告管理' }
                },
                {
                    path: '/feedback',
                    component: () => import('../components/page/artifact/feedback.vue'),
                    meta: { title: '反馈管理' }
                },
                {
                    path: '/unit',
                    component: () => import('../components/page/artifact/unit.vue'),
                    meta: { title: '单位资料认证' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
